package com.jasiri.project.adapter

import androidx.recyclerview.widget.RecyclerView
import com.jasiri.project.R
import com.jasiri.lib.baseadapter.JasiriRecyclerViewAdapter
import com.jasiri.lib.baseadapter.JasiriViewHolderHelper

/**
 * Sikadwa
 * @Author wwdeng
 * @CreateTime: 2024/5/22 16:00
 * @Annotation：数字
 */
class AmountAdapter(recyclerView: RecyclerView?) : JasiriRecyclerViewAdapter<String>(recyclerView, R.layout.item_amount) {

    override fun setItemChildListener(helper: JasiriViewHolderHelper, viewType: Int) {
        helper.setItemChildClickListener(R.id.imgItem) //点击Item
    }
    override fun fillData(helper: JasiriViewHolderHelper, position: Int, model: String) {
        val imgItem = helper.getImageView(R.id.imgItem)
        var showRes = R.mipmap.img_amount_doubt
        when(model){
            "0" -> {
                showRes = R.mipmap.img_amount0
            }
            "1" -> {
                showRes = R.mipmap.img_amount1
            }
            "2" -> {
                showRes = R.mipmap.img_amount2
            }
            "3" -> {
                showRes = R.mipmap.img_amount3
            }
            "4" -> {
                showRes = R.mipmap.img_amount4
            }
            "5" -> {
                showRes = R.mipmap.img_amount5
            }
            "6" -> {
                showRes = R.mipmap.img_amount6
            }
            "7" -> {
                showRes = R.mipmap.img_amount7
            }
            "8" -> {
                showRes = R.mipmap.img_amount8
            }
            "9" -> {
                showRes = R.mipmap.img_amount9
            }
        }
        imgItem.setImageResource(showRes)
    }
}